#ifndef __OLED_H__
#define __OLED_H__

#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>

#define DC_PIN		131
#define RST_PIN		139

#define OLED_DISPLAY_RAM_SIZE	(8*128)

#define ABS(x) (((x) > 0) ? (x) : -(x))

int oled_init(const char *file);
int oled_deinit(void);
void oled_draw_point(uint8_t x, uint8_t y, int color);
int oled_read_point(uint8_t x, uint8_t y);
void oled_clear(void);
int oled_update(void);
void display_line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2);
void display_rect(uint8_t x, uint8_t y, uint8_t width, uint8_t high);

#endif